import request from '@/utils/request'

const URL = '/apartment/renter'

// 获取列表
export function list(params) {
  return request({
    url: URL + '/list',
    method: 'get',
    params: params
  })
}

/** 租客信息新增 */
export function add(params) {
  return request({
    url: URL,
    method: 'post',
    data: params
  })
}

/** 租客信息编辑 */
export function edit(params) {
  return request({
    url: URL,
    method: 'put',
    data: params
  })
}

/** 租客信息删除 */
export function remove(ids) {
  return request({
    url: URL + `/${ids}`,
    method: 'delete'
  })
}

/** 验证人脸 */
export function verify(id, picUrl, name, idCardNumber) {
  return request({
    url: URL + `/verify/${id}`,
    method: 'post',
    params: {
      picUrl,
      name,
      idCardNumber
    }
  })
}

export default {
  list,
  edit,
  add,
  remove,
  verify
}